package com.xx.jenkinsdemo.exception;

/**
 * @description 业务逻辑异常
 */
public class BusinessLogicException extends RuntimeException {

    private static final long serialVersionUID = 6929128789309454528L;

    public static final String defaultMessage = "logic.exception";

    private Object data;

    private Integer ret;

    public BusinessLogicException() {
        this(defaultMessage);
    }

    public BusinessLogicException(Throwable e) {
        super(e.getMessage(), e);
    }

    public BusinessLogicException(String message) {
        super(message);
    }

    public BusinessLogicException(String message, Object data) {
        super(message);
        setData(data);
    }

    public BusinessLogicException(Integer ret, String message, Object data) {
        super(message);
        setData(data);
        this.ret = ret;
    }

    public BusinessLogicException(String message, Throwable throwable) {
        super(message, throwable);
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public Integer getRet() {
        return ret;
    }

    public void setRet(Integer ret) {
        this.ret = ret;
    }
}
